/* MainLayout组件的样式文件 - 从Home.vue中复制的布局样式 */

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

:root {
  --primary-color: #4361ee;
  --primary-dark: #3a56d4;
  --secondary-color: #e2e8f0;
  --accent-color: #4361ee;
  --success-color: #4CAF50;
  --warning-color: #ffd166;
  --danger-color: #ef476f;
  --dark-bg: #ffffff;
  --card-bg: #ffffff;
  --sidebar-bg: #f8f9fa;
  --text-primary: #333333;
  --text-secondary: #6b7280;
  --border-color: rgba(226, 232, 240, 0.8);
  --progress-color: #4CAF50;
}

.main-layout {
  min-height: 100vh;
  background: #ffffff;
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: flex;
  position: relative;
  overflow: hidden;
}

.main-layout::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(67, 97, 238, 0.03) 0%, rgba(67, 97, 238, 0.01) 70%);
  z-index: 0;
}

.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  width: calc(100% - 250px);
  margin-left: 250px;
  position: relative;
  z-index: 1;
}

/* 侧边栏样式 */
.sidebar {
  width: 250px;
  background: #f8f9fa;
  border-right: 1px solid #e2e8f0;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: all 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  position: relative;
}

.logo-icon { 
  font-size: 24px; 
  color: #ffffff;
  background: #4361ee;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
  flex-shrink: 0;
  overflow: hidden;
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5px;
}

.logo-title { 
  font-weight: 700; 
  color: #111827;
  font-size: 18px;
  letter-spacing: -0.5px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-navigation { 
  display: flex; 
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  flex: 1;
}

.nav-item {
  display: flex; 
  align-items: center; 
  gap: 12px;
  padding: 12px 16px;
  margin: 2px 0;
  border-radius: 8px;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
  background: transparent;
  box-shadow: none;
  border: none;
  white-space: nowrap;
}

.nav-item::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: #4361ee;
  border-radius: 0 3px 3px 0;
}

.nav-item:hover { 
  transform: none;
  box-shadow: none;
  background-color: rgba(67, 97, 238, 0.05);
  color: #4361ee;
}

.nav-item:hover::after {
  opacity: 0.5;
}

.nav-item.active { 
  background: rgba(67, 97, 238, 0.1);
  color: #4361ee;
  font-weight: 600;
  box-shadow: none;
}

.nav-item.active::after {
  opacity: 1;
}

.nav-icon { 
  width: 24px; 
  height: 24px;
  text-align: center; 
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: #6b7280;
  background: transparent;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5px;
}

/* 用户头像和未登录状态样式 */
.guest-avatar-small {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  color: #6b7280;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guest-avatar-small svg {
  width: 16px;
  height: 16px;
}

.user-info {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 8px;
}

.user-name {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.user-role {
  font-size: 12px;
  color: #6b7280;
}

.guest-info {
  padding: 12px 0;
  text-align: center;
}

.guest-prompt {
  color: #6b7280;
  margin-bottom: 12px;
  font-size: 14px;
}

.header-login-btn {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  transition: all 0.3s ease;
}

.header-login-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  transform: translateY(-1px);
}

.nav-item:hover .nav-icon {
  transform: none;
  box-shadow: none;
  color: #4361ee;
}

.nav-item.active .nav-icon {
  box-shadow: none;
  color: #4361ee;
}

/* 主内容区 */
.main-content { 
  flex: 1; 
  display: flex; 
  flex-direction: column;
  min-width: 0;
  overflow: auto;
  width: 95%;
  padding: 20px;
  background: #ffffff;
  margin: 0 auto;
  max-width: 1400px;
}

.top-navbar {
  min-height: 70px; 
  background: #ffffff; 
  border-bottom: 1px solid #e2e8f0;
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 0 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.search {
  flex: 1;
  max-width: 400px;
  margin-right: 16px;
  margin-left: 24px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}

.search-input {
  width: 100%; 
  height: 40px; 
  padding: 0 16px 0 36px;
  border: 1px solid #e2e8f0; 
  border-radius: 8px; 
  background: #f8f9fa; 
  outline: none;
  font-size: 14px;
  transition: all 0.2s ease;
  color: #4b5563;
}

.search-input:focus {
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
  background: #ffffff;
}

.nav-actions { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
}

.btn { 
  border: none; 
  cursor: pointer; 
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary { 
  background: #4361ee; 
  color: #fff; 
  padding: 10px 16px; 
  box-shadow: 0 2px 4px rgba(67, 97, 238, 0.2);
}

.btn-primary:hover { 
  background: #3a56d4;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3);
}

/* 通知图标和下拉菜单 */
.notification-dropdown, .user-dropdown {
  position: relative;
  cursor: pointer;
}

.notification-dropdown:hover .dropdown-content,
.user-dropdown:hover .dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

.bell { 
  font-size: 20px; 
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bell svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5px;
}

.bell:hover {
  background: #f1f5f9;
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 600;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

.avatar { 
  width: 36px; 
  height: 36px; 
  border-radius: 50%; 
  border: 2px solid #e2e8f0; 
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.avatar:hover {
  border-color: #4361ee;
  transform: scale(1.05);
}

/* 下拉菜单样式 */
.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  min-width: 240px;
  z-index: 100;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.notification-content {
  min-width: 300px;
}

.dropdown-header {
  padding: 12px 16px;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s ease;
  cursor: pointer;
  color: #4b5563;
  font-size: 14px;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: #4361ee;
}

.dropdown-icon {
  font-size: 16px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5px;
}

.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0;
}

.dropdown-footer {
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
  color: #4361ee;
  border-top: 1px solid #f1f5f9;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.dropdown-footer:hover {
  background: #f8fafc;
}

/* 通知项样式 */
.notification-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.notification-item:hover {
  background: #f8fafc;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notification-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5px;
}

.notification-icon.info {
  background: rgba(67, 97, 238, 0.1);
  color: #4361ee;
}

.notification-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.notification-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.notification-details {
  flex: 1;
}

.notification-title {
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 12px;
  color: #94a3b8;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 标签页样式 */
.tabs-container {
  margin-bottom: 20px;
}

.tabs-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0;
}

.tab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s ease;
  position: relative;
  top: 1px;
  margin-right: 4px;
}

.tab-item.active {
  background: #ffffff;
  color: #4361ee;
  border-color: #e2e8f0;
  font-weight: 600;
  z-index: 1;
}

.tab-item:hover:not(.active) {
  background: #f1f5f9;
  color: #4361ee;
}

.close-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 4px;
}

.close-icon:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.tab-item.active .close-icon {
  color: #4361ee;
  background: rgba(67, 97, 238, 0.1);
}

.tab-item.active .close-icon:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.content-wrapper {
  flex: 1;
  overflow: auto;
}

/* 占位内容样式 */
.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  text-align: center;
  color: #64748b;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.placeholder-icon svg {
  width: 32px;
  height: 32px;
  color: #94a3b8;
}

.placeholder-content h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
}

.placeholder-content p {
  margin: 0;
  font-size: 14px;
  opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .sidebar {
    width: 220px;
  }
  
  .main-container {
    width: calc(100% - 220px);
    margin-left: 220px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
  }
  
  .main-container {
    width: calc(100% - 200px);
    margin-left: 200px;
  }
  
  .logo-title {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }
  
  .sidebar-header {
    padding: 16px;
  }
  
  .main-navigation {
    flex-direction: row;
    overflow-x: auto;
    padding: 12px 16px;
  }
  
  .nav-item { 
    white-space: nowrap;
    min-width: auto;
    margin: 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  
  .nav-item::after {
    left: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 3px;
    border-radius: 3px 3px 0 0;
  }
  
  .main-container {
    width: 100%;
    margin-left: 0;
  }
  
  .main-content {
    max-width: 100%;
    padding: 16px;
    width: 100%;
  }
}